add compileBlockEnd to reduce code complex