add battery charge control