fixed bugs in levelChange