improve fix for mac