refactored code to load detail so that I could load the detail on page load.