bug fixes of collect.