improve fail message and use itertools chain