Added flash messages based on type