Added shutdown sequence