added local var messageBuffer