added ability to set flash messages in case templates depend on them