handle the error path for mac