changed retraction command to save state