Fix orphan instance problem