fixed early-stop bug problem