The paths changed for 18 and again for 19. Refactor and improve the detection logic to consider this. This also should make the code more maintainable.