add: add error handler to validate the options