Fix a bug when refreshing the local definition