adds mac compatibility (a bit)