changed code to sync every block