Add counter for checking all PEER_JOIN events have created
Change the way of setting event time
Add a white space after if-condition and loop command