fixed error code issue:

errorcode was never refreshed