fixed bug with length()