fix bug on mac