adding menu function to layout