deleted test function writeMessage()