fix memery leak of blocks