better error reporting
pass options object properly