add sleep hook