fixed some bugs with the robot logic