correctly detect checkbox