create function to be clled on page load