Added an option validity check