add server shutdown hook after upload