fix function ExtractPath bug