fix bug: crash in refreshing