better reporting of error