creating a thread to check if user is registered or not