prevent bad path in debug cause crashing.