fix bug + query builder