Added if statement to handle when menu is not available, i.e. 'undefined.' Instead of link, will receive message that no menu is available.