Fixed bug due to changed variable name