flash messages added to functions