added fix for leading,trailing slashes
added fix for leading,trailing slashes