Added logic for login and getting location