implemting query callback in trans