Fixed refreshing bug