added graceful fail if blank distance