also return length from decode