properly handle checkbox serialization