clean up error code