I found out when I made a command block that would say "hi" when I touch the ground. The problem is that when I teleport myself to the air, whether it be with ~ ~ ~, ^ ^ ^, or any coordinates, the command block would say "hi" despite me being far away from the ground.
Please provide the exact commands used.