Added reconnection check and log