fixed bug with refreshing data