fixed bug in mongo query builder