bug fix of alg2step4