Fix variable shadowing in create_base_message