Add script event observer to detect append event