Adding proc script cleaning function