Update setBlock function.