fix the bug (negative row and col index)