bug corrected in length, length of an empty table is now 0