moving message assignment out of authenticate