fix path detection