added reconnect timeout of 5 seconds