add new getBaseUrl method to calculate relative url