Added compatibility for macosx systems