public function clear($type = FALSE)
  {
    
	if ($type === FALSE){
		
		$this->_session_unset();
	}
	else {
		
		$messages = $this->_session_get();
		
		if (is_array($messages))
		{		
			foreach($messages as $i=>$message){
			
				if ($message->type == $type){
					
					unset($messages[$i]);
				}
			}
			
			if (!$this->count())
			{
				$this->clear();
			}
			else {
			
				$this->_session_set($messages);
			}
		}
	}
	
    return $this;
  }