finish dir edit function