extracting basename of path to target