added query locks