avoid panic, when connect failed