added battery check