move the reload to outside of the defered time function