Fix invalid getWriter call