function to get base url