fixed reelection bug and removing resends
updated demo to avoid use of Await.result