saving after each move