added message logging