added logic for shutting off automatically when charging timeout expires