getting deadlock but adding printf to know who's receiving a message