Fixed resync bug