add targetmodel
arranged the condition branch of ApplyButton