Set status code before hijackwrite function

...r-defined function