Added quit mechanism