add powerdevil-9999 from eliasp PR with recommended changes