added extra error reporting