save data on exit. still need to handle the refrshe rates