fix, avoid trailing slash when id is empty