Defining the hook function acts as a on page load script