change fromJSON to extend.