properly shut down handlers