some cleanup
adding shutdown routine