changed login to be email
fixed loading function bug