public function setMessage($data)
    {
        // initialize a flash session variable
        if(!isset($_SESSION['flash'])) {
            $_SESSION['flash'] = array();
        }

        // check for valid message template. Set to default if not valid
        if(!in_array($data['type'], $this->valid)) {
            $data['type'] = $this->valid[0];
        }

        $_SESSION['flash']['type'] = $data['type'];
        $_SESSION['flash']['message'] = $data['message'];

        return true;
    }