Rewrites and added a timer to refresh duration