Fix issue #18 - alter is writeQuery