added fn_getquery