modified all_signal4 continue with the check on the distance