Tp not through blocks

So I need knockback and ik kinda already did it. this is te command

/execute at @s as @e[distance=1..3] facing entity @s eyes run tp @s ^ ^ ^10

but the problem is that if I look up the entities behind me get teleported inside a block. how can I fix this?

Continue to help post