Fix a bug for unit unlock