implemented better flash messages