better error report
more error handling