bug fixed but error still increase as loop goes