fix issue with flash messages