modified some queries