commit before memory changes