clean function fixed