Correct afterRelease function