recusion check shold be in directories