fix power switch bug