fix bug in adding directories in checkout.

TBR