added code for dynamic menu bar