testing serializing function