Added auto-reload code