Getting appElement for paths too, not only pids.