onAfterWrite fix