Created pageLoad function