public function peek($type = FALSE)
  {
  
	$messages = $this->_session_get();
	
	if (!is_array($messages)){
		
		return array();
	}
	
    if ($type === FALSE)
    {
	   return $messages;
    }
    else
    {
		$tmessages = array();
		
		foreach($messages as $message){
		
			if ($message->type == $type){
				
				$tmessages[] = $message;
			}
		}
		
		return $tmessages;
    }
    
  }