Fix buildWhere