working automatic reconnection