fixed crash that could occur due to level being deleted incorrectly