Fix freeze for windows