fix the serialize() method so checkboxes work correctly