fixes for darwin to work with refactor