clear memory after save