fixed minor bug in query and response