Callback required, and fixed a bug in querysingleton