fix OSX, readlink not so great on Darwin