fix email issue and change login for username authentication