added callbacks to sync
fixed processBlock