<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def when_value_edited(self, *args, **kargs):
 """ Overrided to prevent user from selecting too many instances """

        if len(self.value) > self.instance_num:
            self.value.pop(-2)
            self.display()