plot density line using lines in r


Hi, I am trying to plot a density curve on top of the density histogram. My code works fine in the first graph, which shows by a red line almost identical with the histogram; however, I cannot see the red line in the second graph by using identical code but different data set.
It seems line lines() does not work

use:

curve( rchisq(100000, df = 1), add = TRUE, 
       col = rgb(1,0,0,.4), lwd = 3)

lines doesn't work :relaxed: @Kevinn