Updating deprecated methods for flash messages