fix a reconnect bug, add more checks to ensure right params in lambda