improvements on rake tasks to avoid dying