Added shutdown procedures