add if_checked, if_selected function