bug fix for incorrect status header being returned