error on invalid input and pass opts properly