added some button handlings