fixed a bug, only occuring on osx