fixed bug in error reporting

Change-Id: If542e6809d884a185810fbe9151021bcad76f41f