avoid using readlink for OSX compatability