fixed a bug that caused instance loss