Check length before appending