Fix for osx, make it work without realpath command