catch errors
add distance