small logic to check if there a direct state in the path