diff --git a/package.xml b/package.xml
index 9f9f7a29..14d9abd3 100644
--- a/package.xml
+++ b/package.xml
@@ -14,6 +14,7 @@
ament_cmake
+ ros_environment
rclcpp
rcpputils
rosbag2_transport
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index fb512d84..5ccde2d1 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -47,7 +47,7 @@ target_link_libraries( TopicPublisherROS2 commonROS)
message("AMENT_PREFIX_PATH = ${AMENT_PREFIX_PATH}")
message("ROS_DISTRO (env) = $ENV{ROS_DISTRO}")
-if("${AMENT_PREFIX_PATH}" STREQUAL "/opt/ros/humble" OR "$ENV{ROS_DISTRO}" STREQUAL "humble")
+if("$ENV{ROS_DISTRO}" STREQUAL "humble")
message(STATUS "Detected Humble")
target_compile_definitions(DataLoadROS2 PUBLIC ROS_HUMBLE)
target_compile_definitions(TopicPublisherROS2 PUBLIC ROS_HUMBLE)