added receive msg and time functionality