power:fix error caused by code in wrong order