add toJSON method
add toJson method