Implementing function to quit button