better handling of null responses