more work on button event funtion