bug fix for 'collect'