Fix random crash while refreshing