Yeah I know the main function is only called once, so after every level change I manually call he main function again to set everything up. I don't think that explains why key presses are recognized every other time I call the main function.