enhanced end of level code to be more reliable