updating insert to use json