modified add_back_links_to_dom to work in all navigation steps and eliminated previous duplicated back link generation code