fixed bug when app was forced to die