Move handler.cancel to listener