fix swing issue when loading