fix to work on Mac OSX.