The mtcars data set doesn't contain a variable called qsec_before and you are not defining it anywhere in your code, that is why you get the NULL error, you should check on that.
names(mtcars)
[1] "mpg" "cyl" "disp" "hp" "drat" "wt" "qsec" "vs" "am" "gear" "carb"