fixed incorrect usage of variable