tried to solve a bug occuring on windows but not on linux