fix bug with MacOS