Made some changes for compatibility with menus