added method that accepts message array