fixed sql ambiguity