reading from and writing to json now works