fix some problems with the menu code: