Dir. Structure in loop and trace not being saved