Restore the code for the target button management

close #3