make append accept by-name param to avoid evaluation of tail in flatMap