Fixed bug for relative path, could not handle ".." correctly so changed to use the same function as on other similar places