add try catch for basic server's receiveMsg function