fixed compiling on OS X