fix IsPowerAvailable function in power library