add a bit more error reporting