Use readlink instead of realpath for mac support