fixed checkbox functionality

Fixed checkbox functionality, mostly