Adds purge functionality