added basic channel handling (including recognising queries)