fix path function