fixed bug when closing jsonItem (had to reset the depth)