Changed to use OnSendingHeaders event