better sync logic