fixed logic bug in handleOperator