remove unnecessary character in the path