added thread safe mechanism for updating GUI message