fix the codeblock functions