Leeds coach Daryl Powell was relieved to escape with his team's unbeaten home record intact after the Rhinos were taken all the way by a determined Castleford side on Saturday.
Dean Sampson made the first start of his Castleford comeback
Powell's men twice came from behind to win 39-26 and consolidate their position at the top of Super League, with winger Francis Cummins scoring two of their seven tries to reach a Super League century.
Powell said: "I thought Castleford played extremely well but we didn't help ourselves by making numerous errors."
But he added: "We've got to be happy that we're still at the top of the pile but we have to improve a little bit."
Castleford, who had won their three previous games, handed 35-year-old Dean Sampson his first start since his comeback and gave a debut to 17-year-old prop Craig Huby after Nathan Sykes pulled out of the match to attend the birth of his first child.
We will look a lot healthier next week when there is a possibility of three players coming back
Tigers coach Graham Steadman said of his team's effort: "The 80 minutes took its toll and with 20 minutes to go we were playing catch-up. It was a big ask and we just fell short.
"We had an average age of 19, 20 on the bench, which makes it very difficult, but the experience will put them in good stead.
"And we will look a lot healthier next week when there is a possibility of three players coming back."