Updated application path retrival function.