Changed commands to setlatched and setengaged