remove trailing dots from directory name