Added the EOF logic on the streams... but something seems a bit strange
sending the final message to the bm does not occur until closing the fd