fix reference error in json handling

Closes #3