it has to be $this->dbg(), and not just dbg()