using data structure from pages, added check_menu function