fix a array index bug. it should be start in 0, not 1.