added record functionality to button.