merge before_render into before_dispatch