fix issues when reconnecting