fix bug of LENGTH helper