changed the structure of emitting, causing logins to be faster, also added validation to input