Revert "Fixed directory not exists"

This reverts commit d31d60f80123374e9db5445e4dfbfb4a2e01c3fc.
Revert "Revert "Fixed directory not exists""

This reverts commit 9163602b57bdca61443ec17b1530bb18eb080a58.