updated javascript to recognize to checkboxes