modified trailing directory separator in  as well as