fix error with delete query