simplify condition test for trailing /