make sure pipes get closed after iterating views