made checkButton more efficient