fix for macosx seg faults