fixed bug with returning json