get absolute path before cd-ing to new dir