check res.headerSent before send data