Fixing dynamic menu to be loaded from java