added some checking for the options