channel read function