stop server when app closes