Fixed a bug (Exception ocurred when plugging AC adapter)