Added auto reload code