Fixed race conditionss in Server while registering new clients.