Changed if statements, but it doesn`t solve the problem with checkboxes.