bug fix: need num of rows