correcting check box logic to send function call to server