can pass query to delete method, closes #559