fix issues on MacOSX