TO DO Fix issue 
problem creating file
Document d is always null