fix a small issue with row index