fixing toJSON for Dropbox piles