handle undefined responses