update building query