Changed client id to clients ip-address. Changed one type-check to hasattr-check to conform to duck-typing python idiom