fixed issues in line capacity code