Fix delete by query