fixes broken auto refresh function