Fix build url function