fixed SEH exception on Windows