fix a bug that causes invalid abs. pathname