Fix gets bug in game loop