added functionality for the buttons