change onapplicationfocus to onapplicationpause