properly parse relative path