Added the Interrupt flag for stopping the background thread
Implemented the sendMessage method