Resolved issue with deleting queries

Signed-off-by: Sheik Hassan <solergiga@yahoo.com>
Merge pull request #287 from muslimgiga/issue-286

Resolved issue with deleting queries