added cleanup code to stop syncer on exit