added better login functionality and it works