works on mac (replace readlink -f)