update code for detecting another running instance and sending a message to it