better error reporting
put under MIT license