issue # 154, added null check and throw ExchangeException