updated the logic to add detail info dynamically by code