Fix access to undefined response
Previous code caused TypeError: Cannot read property 'pap' of undefined in case of errors.