only use serialize method if it is available
0.1.4