remove duplicates
remove scratch directory