Always remove the alarm before changing the handler, not the other way around.