make trailing slash optional