fixed various login bugs