Fixing bug with sync and log