logic for login and profile ready