fix a bug in buildVariableKeyName