how to handle button clicks