patched template editor frame and per_request_setup method