fixed the delete query