Avoid potential race condition and localizing code to be changed in SparkPolymer