add function to exitapp on ios