added pause and end of level check