Fixed logic for server when handle new connection