Added an in sync flag on service state

clever use of switch