Running loops and error message

When I try running dynare in a loop, I sometimes get this error message
-----------
Processing outputs ...ERROR: Can't open file filename_static.m for writing
??? Error using ==> dynare at 114
DYNARE: preprocessing failed
--------------
Is there any way to avoid this? I have tried in some cases with success to slow down the execution of the loop, but that defeats a little bit the purpose. Any other suggestions?
-----------
Processing outputs ...ERROR: Can't open file filename_static.m for writing
??? Error using ==> dynare at 114
DYNARE: preprocessing failed
--------------
Is there any way to avoid this? I have tried in some cases with success to slow down the execution of the loop, but that defeats a little bit the purpose. Any other suggestions?