fixing getting 'unresponsive Script' message when switch between the panels