fixing inconsistent variable name and missing require