bug with directories fixed