added check if an option is valid to optionIsSet