Fixes #248 : "local variable 'resp' referenced before assignment"