fixes to app termination and location recordings