Move log inside each block - no clue why this might be necessary