fixed to compile under OSX