Adding default callback for serialization if serialization is turned on