US shares regain ground after big losses