fixed onClose
refactored PalaceEvent