Technology gains help US stock markets cancel out early losses from health sector