updated so that autorefresh works