adding support for trailing slash