commit the current state