added if() on the checkbox