fixed issue #18 - alter is writeQuery