fix a bug, add handle connection function declaration