How to work with flash messages