Hack for darwin only. This needs to be made smarter soon.