Fix directory moving bug

Fix directory moving bug