Fix response nil pointer issue