fix error in automated_operate