Handle quit command