fix compatibility with Mac