fixed bug in message printing