changed to JSON method