corrected mis-used variable