fixing sync bug