fixed error in collect()