New sync implementation. Last one was wrong.