fix UnboundLocalError: local variable 'res'

closes #10
fix UnboundlocalError when a role could not be found