fix empty directory problem