Added auto-reload code from hybrid branch