bug fixing in query writer
Merge pull request #76 from isururanawaka/master

bug fixing in query writer