add refresh detection