Solving flash messages issue