changed for teach and servo mode