Added option to control enabling of menu when not empty.