Closing panel with code still leaves app in panel state?!!!

I have some code that opens a panel window, then in the “on opened” handler of the panel window, I have this…

on opened theObject
	delay 1
		if not (do shell script "ps cax | awk '/extract-xiso/{print $5}'") = "extract-xiso" then
			exit repeat
		end if
	end repeat
	close panel statusPanel
end opened

now…this works fine…the panel window closes, however, the app is left in a “panel” state so to speak…all the buttons can’t be clicked and all the menus are greyed out…what am I doing wrong?