removed redundant lines from appendBaseUrl function