added raw query request, some bugs fixed