Added flash messages functionality