fixed issue of finding the correct url prefix when there was slash in
the end of the url