lots of checks to try not to crash on clear and display
distance