Added quit button functionality