fix today index out of bound bug