Adding in a check to render multi level directories properly