directory layer fixed and more code added