chage Error to ErrorCode
start of error handling