bugfix to ensure travisCI passed on ruby1.8.7 (collect.with_index not supported)