fixed MacOSX compatibility