Fixed deletePIPA and applied DISTINCT to query.
Fixed - WF-1531