For receive msg in Main.java -> onEvent()
refactor code
add receiving function and refactor code