Fixing an issue with checkbox button selection