Fixed checkbox function