adding quit functionality