fix check for mac end.