Fixing undef resp in error condition