fixed issue when refreshing databases