multiple clients are handle now with exit condition