fixes for timeout/reconnect logic