Fixed beforeRender error