fix performence issue when rendering big block of code.