apply spread_local patch for singleton