ok, here's the corrected version to keep the original directory mode intact.