Added invalid args check for distance and sap