remove trailing slash code - no agreement on best practice