Modified CastService to make more connection safe