Updated method of deactivating app so it returns immediately and Frank scripts are able to do some processing while the app is in background.