Added directory initialization code