Query builder fixed