added resume on reconnect and unit tests