Bug fix when app recovers from a crash