Fixed bug with sending back JSON