added afterSerialize public method