added logic to prevent double slashes in urls
fixed basepath issue