!don't add the message to redirects;
*rewritten to support also "type" parameter; -support for closing curly brackets;