use trap to terminate the hardware