moved error handling from user agent to transaction