Added  a function to check if the main option is selected.