prf stuff, some changes to QueryHandler.java