solve some bugs, add poweroff