max_retries and bug fix for home directory