Fix for flash messages not being removed