work with or without tailing slash