made path detection (more) platform independant