Fix when trying to change parent of a json object