log fixed
now does not crash in MAC