fix trailing slash check for Windows