fix folding bug