fix delete query issue