fixes logout on internet reconnect and various errors