modified getDeleteQuery method

modified getDeleteQuery method