Added table lenght verification to addGrid.