fixed some error reporting