implement ignore self packet
fix events is null, null pointer exception
refactoring and tidy up some code regarding send and receive packet