fix cleanup function - should not wait for shutdown - should terminate (delete) instance