Add logic on page loading

Add logic on page loading