fixed a bug on macs