Fixed refresh logic. Added error handling and chill after max errors.