change exitapp function