Implemented shutdown method