Fixed bug where value var was used instead of key