Update find path function