How to create a sleeping state