errata: get flash messages with function