added json and error