updated to pass a list of pages to controller and load in the navbar