Added self-clean function