fix timeout to use error passing convention