dealt with flash messages