fixed logical error in message output