added before_render hook