added method to set flash message