Fixed misuse of variable