added path relative function which also goes upwards