Implemented shutoff function with APM.