bug fix on MacOS