fixed logic what saves last time when application was crashed