Moved Handler cleanup in run() function