created login function, not by buttons