changed json coding to dictionary