changes before_destroy and flash