Fix PhoneGap app exiting