public function setAttribute($key, $val)
    {
        if(is_null($val) && array_key_exists($key, $this->attributes))
            unset($this->attributes[$key]);
        else
            $this->attributes[$key] = $val;
    }