fix flash message for User class without username field