Handling checkboxes properly using hidden fields