renamed $this->Mode to $this->Type

access to non-existing variable $this->Mode caused errors