Game loop fix