better detection of app root path