fix bug when using symlinked dir