Making legend update