Make on_branch method backwards compatible