Resolved issue with deleting queries

Signed-off-by: Sheik Hassan <solergiga@yahoo.com>