fix multiple response.WriteHeader calls