This extends the procedure to sleep and move back which means that cancel gets more complicated.
cancel
Also take care of more states as @hickind suggested.
FYI @smithm
Feedback still welcome.