Add afterReviving function to make sure objects are used after they have been revived