added 'beforeMenu' dynamic property to specify where to insert the menu UIs