bug fix, length method