Clean up task handler