reset and doneWithLevel variables added