Use getBaseUrl() instead of detectBaseUrl()