rebuild, fix bugs, add alert and confirm mode