Sounds like race condition to me. It is possible that you are trying to copy 1.html to results.html, while 1.html is being created, possibly resulting in some sort of dead-lock. Your best best is to review your system design and architecture, identify possible race conditions, and set semaphores/locks to avoid it. Without much detail in your description, this is the best suggestion I can offer.