Reconnect db if timed out