fixed bug with resync