fix for OSX and remove unnecessary lines