Add Integration test
Shutdown logic improved
Integration test added