Fixed problem with channels
Modularized