fix beforeRender initialisation