Added sync related variables and checks.

Added sync related variables and checks.