fixed #serialize method