fixed hasValidLength() ReferenceError. called wrong function name. lol