fix parallel bugs