added differing function for linux vs osx