Fixed bug that avatar cannot be saved if subdomain was used