fix bug in mac