Define before_save callback 'set index' instantiating all tasks at 1 unless otherwise specified