add one line to remove trailing slash of DIR