added smart pointers for messages