added better error handling. added auto-reload when resume file changes