now works to communicate with json