added method to get number of rows from table