Tidied up check_page_loaded