Flash message refactored and working