fix UnboundLocalError: local variable 'message' referenced before assignment
Merge remote-tracking branch 'upstream/master'