Fixed onClose repeat