improved the search of environment variables for HOME