more serialization implementation

This check is odd at this place - you already did some of the work before. And checking the first element of `$sorts` is a rather indirect way of getting to the info you need.