Disable menu item based on if the operation cannnot be performed