adapted for osx env