error handling added when the options are not given