Fixed the level increasing by one bug