wrap channel in state
fixed some stuff