fix bug on mac os