fix issue with channel closing
support keepalives
fix varname