fixed error reporting in A and B