repair a logical error causing by indent