escape the paths correctly