some changes for query