security cleanup method