Synchronized the sample code