Some bug fixed on update/query handlers