that really does not solve the problem. All in all the mainfunction works, it also calls the funtion if i press l, the problem is, that it is killed after that.
If i call any other function it works without any problems.
EDIT: I found out, that the first Problem doesn't occur, if I comment out the wait()..