Fix wrong use of collect method