fix mac compatibility