Fixed the bug occurring when add a page to an empty menu