added validation if option is invalid