fixed accuracy of panel visibility test