Adding debug when sending and receiving messages