wrap getmtime in a try block to avoid race condition with temporary files