fixed OSX compatibility