Fixed sync's functionality