added method for flash messages