added toJSON to elements