fixed strange bug with different behaviour on windows