fixes for MacOS