fix while boundary