fixed bug in level.cpp