A few changes

add a delegate to detect button