Solve the bug in the program when checked is clicked