check if panel is visible before refreshing