simplify condition test for trailing /

merge into develope branch