Fix a bug while creating recursive dirs