added extra hook to prepare sleep