rework waiting connection and waiting reconnection