hook for hibernation