lock the set_message_types() method