converting /../ to dirname()