fix safe directory to copy check