added test for query issue and finally fixed