Fixed a bug caused by a wrong variable name