Correct bug due to wrong variable name used.